// 公共接口
import { filePost, request } from "@/utils/http.js";

import globalConfig from "@/utils/config.js";

const baseUrl = globalConfig.microUrl;
const apiUrl = globalConfig.baseUrl;

export default {
  // 行业之星_活动详情
  getActivityDetail: (data) => {
    return request({
      url: `${baseUrl}/market/activityHy/get`,
      method: "GET",
      data
    });
  },
  // 行业之星_选手详情
  getPlayerDetail: (data) => {
    return request({
      url: `${baseUrl}/market/activityHyPlayer/get`,
      method: "GET",
      data
    });
  },
  // 获取行业之星_候选人列表
  getHyPlayerList: (data) => {
    return request({
      url: `${baseUrl}/market/activityHyPlayer/getHyPlayerList`,
      method: "GET",
      data
    });
  },
  // 行业之星_报名
  signUp: (data) => {
    return request({
      url: `${baseUrl}/market/activityHySignup/signup`,
      method: "POST",
      data
    });
  },
  // 获取报名详情
  getSignUpDetail: (data) => {
    return request({
      url: `${baseUrl}/market/activityHySignup/get`,
      method: "GET",
      data
    });
  },
  // 上传图片
  uploadImg: (data) => {
    return filePost({
      url: `${apiUrl}/market/activityHySignup/uploadImg`,
      filePath: data.file
    });
  },
  // 投票
  activityHyVote: (data) => {
    return request({
      url: `${baseUrl}/market/activityHyVote/vote`,
      method: "GET",
      data
    });
  },
  // 荣耀榜
  getGloryList: (data) => {
    return request({
      url: `${baseUrl}/market/activityHyPlayer/getGloryList`,
      method: "GET",
      data
    });
  },
  // 任务列表——未登录时调用
  getTaskList: (data) => {
    return request({
      url: `${baseUrl}/market/activityTask/list`,
      method: "GET",
      data
    });
  },
  // 任务列表——登录后调用
  getTaskMembeList: (data) => {
    return request({
      url: `${baseUrl}/market/activityTaskMember/list`,
      method: "GET",
      data
    });
  },
  // 优惠券获取记录
  getLogList: (data) => {
    return request({
      url: `${baseUrl}/market/activityTaskLog/list`,
      method: "GET",
      data
    });
  },
  // 是否开启预热
  getIsActivityWarmUp: (data) => {
    return request({
      url: `${baseUrl}/market/activityTask/isActivityWarmUp`,
      method: "GET",
      data
    });
  },

  // 获取活动有礼落地页按钮状态
  getActivityLandingPage: (data) => {
    return request({
      url: `${baseUrl}/market/activity/getActivityLandingPage`,
      method: "GET",
      data
    });
  }
};
